//评到列表
import { useEffect, useState } from 'react'
import {getChannelsAPI} from '@/apis/active'
import { Select } from 'antd'
const { Option } = Select
const ChannelList =()=>{
    const [channelList,setChannelList ] = useState ([])
    useEffect( ()=>{
        //评到列表
        
        const getChannelList =async()=>{
            //封装调用后台函数
            const res  =  await getChannelsAPI()
            console.log()
            setChannelList(res.data.data.channels)
        }
        //调用后台函数
        getChannelList()
        },[])

    return (
        <div>
            {channelList.map(item=> <Option key={item.id} value={item.id}>{item.name}</Option>)}
        </div>
    )   
}

export default ChannelList